﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="dodajBadaniaKrwi.aspx.cs" Inherits="STS.Pacjent.dodajBadaniaKrwi" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>
    Podaj Pesel:
    <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
&nbsp;
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="OK" />
    <br />
</p>
<p>
    <strong>PACJENT:</strong><br />
    <asp:Label ID="imie" runat="server" Text="Label"></asp:Label>
&nbsp;<asp:Label ID="nazwisko" runat="server" Text="Label"></asp:Label>
&nbsp;<asp:Label ID="Pesel" runat="server" Text="Label"></asp:Label>
&nbsp;<asp:Label ID="miasto" runat="server" Text="Label"></asp:Label>
&nbsp;<asp:Label ID="id_pacjenta" runat="server" Text="Label" Visible="False"></asp:Label>
    <asp:Label ID="data" runat="server" Text="Label" Visible="False"></asp:Label>
</p>
    <p>
    &nbsp;<asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" 
            DataKeyNames="id_badania" DataSourceID="SqlDataSource1" DefaultMode="Insert" 
            Height="50px" Width="125px">
            <Fields>
                <asp:BoundField DataField="id_badania" HeaderText="id_badania" 
                    InsertVisible="False" ReadOnly="True" SortExpression="id_badania" />
                <asp:BoundField DataField="data_badania" HeaderText="data_badania" 
                    SortExpression="data_badania" Visible="False" />
                <asp:BoundField DataField="WBC" HeaderText="WBC" SortExpression="WBC" />
                <asp:BoundField DataField="RBC" HeaderText="RBC" SortExpression="RBC" />
                <asp:BoundField DataField="Hemoglobina" HeaderText="Hemoglobina" 
                    SortExpression="Hemoglobina" />
                <asp:BoundField DataField="Hematokryt" HeaderText="Hematokryt" 
                    SortExpression="Hematokryt" />
                <asp:BoundField DataField="MCV" HeaderText="MCV" SortExpression="MCV" />
                <asp:BoundField DataField="MCH" HeaderText="MCH" SortExpression="MCH" />
                <asp:BoundField DataField="MCHC" HeaderText="MCHC" SortExpression="MCHC" />
                <asp:BoundField DataField="Plytki_krwi" HeaderText="Plytki_krwi" 
                    SortExpression="Plytki_krwi" />
                <asp:BoundField DataField="RDW_SD" HeaderText="RDW_SD" 
                    SortExpression="RDW_SD" />
                <asp:BoundField DataField="RDW_CV" HeaderText="RDW_CV" 
                    SortExpression="RDW_CV" />
                <asp:BoundField DataField="PDW" HeaderText="PDW" SortExpression="PDW" />
                <asp:BoundField DataField="MPV" HeaderText="MPV" SortExpression="MPV" />
                <asp:BoundField DataField="P_LCR" HeaderText="P_LCR" SortExpression="P_LCR" />
                <asp:BoundField DataField="PCT" HeaderText="PCT" SortExpression="PCT" />
                <asp:BoundField DataField="p_neutrocyty" HeaderText="p_neutrocyty" 
                    SortExpression="p_neutrocyty" />
                <asp:BoundField DataField="p_limfocyty" HeaderText="p_limfocyty" 
                    SortExpression="p_limfocyty" />
                <asp:BoundField DataField="p_monocyty" HeaderText="p_monocyty" 
                    SortExpression="p_monocyty" />
                <asp:BoundField DataField="p_eozynocyty" HeaderText="p_eozynocyty" 
                    SortExpression="p_eozynocyty" />
                <asp:BoundField DataField="p_bazocyty" HeaderText="p_bazocyty" 
                    SortExpression="p_bazocyty" />
                <asp:BoundField DataField="neurocyty" HeaderText="neurocyty" 
                    SortExpression="neurocyty" />
                <asp:BoundField DataField="limfocyty" HeaderText="limfocyty" 
                    SortExpression="limfocyty" />
                <asp:BoundField DataField="monocyty" HeaderText="monocyty" 
                    SortExpression="monocyty" />
                <asp:BoundField DataField="eozynocyty" HeaderText="eozynocyty" 
                    SortExpression="eozynocyty" />
                <asp:BoundField DataField="bazocyty" HeaderText="bazocyty" 
                    SortExpression="bazocyty" />
                <asp:BoundField DataField="NRBC" HeaderText="NRBC" SortExpression="NRBC" />
                <asp:BoundField DataField="potas" HeaderText="potas" SortExpression="potas" />
                <asp:BoundField DataField="kreatynina" HeaderText="kreatynina" 
                    SortExpression="kreatynina" />
                <asp:BoundField DataField="id_pacjenta" HeaderText="id_pacjenta" 
                    SortExpression="id_pacjenta" Visible="False" />
                <asp:BoundField DataField="id_lekarza" HeaderText="id_lekarza" 
                    SortExpression="id_lekarza" Visible="False" />
                <asp:CommandField ButtonType="Button" InsertText="Dodaj" 
                    ShowInsertButton="True" />
            </Fields>
        </asp:DetailsView>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:MGRConnectionString %>" 
            DeleteCommand="DELETE FROM [badania_krew] WHERE [id_badania] = @id_badania" 
            InsertCommand="INSERT INTO [badania_krew] ([data_badania], [WBC], [RBC], [Hemoglobina], [Hematokryt], [MCV], [MCH], [MCHC], [Plytki_krwi], [RDW_SD], [RDW_CV], [PDW], [MPV], [P_LCR], [PCT], [p_neutrocyty], [p_limfocyty], [p_monocyty], [p_eozynocyty], [p_bazocyty], [neurocyty], [limfocyty], [monocyty], [eozynocyty], [bazocyty], [NRBC], [potas], [kreatynina], [id_pacjenta], [id_lekarza]) VALUES (@data_badania, @WBC, @RBC, @Hemoglobina, @Hematokryt, @MCV, @MCH, @MCHC, @Plytki_krwi, @RDW_SD, @RDW_CV, @PDW, @MPV, @P_LCR, @PCT, @p_neutrocyty, @p_limfocyty, @p_monocyty, @p_eozynocyty, @p_bazocyty, @neurocyty, @limfocyty, @monocyty, @eozynocyty, @bazocyty, @NRBC, @potas, @kreatynina, @id_pacjenta, @id_lekarza)" 
            SelectCommand="SELECT * FROM [badania_krew]" 
            UpdateCommand="UPDATE [badania_krew] SET [data_badania] = @data_badania, [WBC] = @WBC, [RBC] = @RBC, [Hemoglobina] = @Hemoglobina, [Hematokryt] = @Hematokryt, [MCV] = @MCV, [MCH] = @MCH, [MCHC] = @MCHC, [Plytki_krwi] = @Plytki_krwi, [RDW_SD] = @RDW_SD, [RDW_CV] = @RDW_CV, [PDW] = @PDW, [MPV] = @MPV, [P_LCR] = @P_LCR, [PCT] = @PCT, [p_neutrocyty] = @p_neutrocyty, [p_limfocyty] = @p_limfocyty, [p_monocyty] = @p_monocyty, [p_eozynocyty] = @p_eozynocyty, [p_bazocyty] = @p_bazocyty, [neurocyty] = @neurocyty, [limfocyty] = @limfocyty, [monocyty] = @monocyty, [eozynocyty] = @eozynocyty, [bazocyty] = @bazocyty, [NRBC] = @NRBC, [potas] = @potas, [kreatynina] = @kreatynina, [id_pacjenta] = @id_pacjenta, [id_lekarza] = @id_lekarza WHERE [id_badania] = @id_badania">
            <DeleteParameters>
                <asp:Parameter Name="id_badania" Type="Int32" />
            </DeleteParameters>
            <InsertParameters>
                <asp:ControlParameter ControlID="data" Name="data_badania" PropertyName="Text" 
                    Type="DateTime" />
                <asp:Parameter Name="WBC" Type="Double" />
                <asp:Parameter Name="RBC" Type="Double" />
                <asp:Parameter Name="Hemoglobina" Type="Double" />
                <asp:Parameter Name="Hematokryt" Type="Double" />
                <asp:Parameter Name="MCV" Type="Double" />
                <asp:Parameter Name="MCH" Type="Double" />
                <asp:Parameter Name="MCHC" Type="Double" />
                <asp:Parameter Name="Plytki_krwi" Type="Double" />
                <asp:Parameter Name="RDW_SD" Type="Double" />
                <asp:Parameter Name="RDW_CV" Type="Double" />
                <asp:Parameter Name="PDW" Type="Double" />
                <asp:Parameter Name="MPV" Type="Double" />
                <asp:Parameter Name="P_LCR" Type="Double" />
                <asp:Parameter Name="PCT" Type="Double" />
                <asp:Parameter Name="p_neutrocyty" Type="Double" />
                <asp:Parameter Name="p_limfocyty" Type="Double" />
                <asp:Parameter Name="p_monocyty" Type="Double" />
                <asp:Parameter Name="p_eozynocyty" Type="Double" />
                <asp:Parameter Name="p_bazocyty" Type="Double" />
                <asp:Parameter Name="neurocyty" Type="Double" />
                <asp:Parameter Name="limfocyty" Type="Double" />
                <asp:Parameter Name="monocyty" Type="Double" />
                <asp:Parameter Name="eozynocyty" Type="Double" />
                <asp:Parameter Name="bazocyty" Type="Double" />
                <asp:Parameter Name="NRBC" Type="Double" />
                <asp:Parameter Name="potas" Type="Double" />
                <asp:Parameter Name="kreatynina" Type="Double" />
                <asp:ControlParameter ControlID="id_pacjenta" Name="id_pacjenta" 
                    PropertyName="Text" Type="Int32" />
                <asp:CookieParameter CookieName="id" Name="id_lekarza" Type="Int32" />
            </InsertParameters>
            <UpdateParameters>
                <asp:Parameter Name="data_badania" Type="DateTime" />
                <asp:Parameter Name="WBC" Type="Double" />
                <asp:Parameter Name="RBC" Type="Double" />
                <asp:Parameter Name="Hemoglobina" Type="Double" />
                <asp:Parameter Name="Hematokryt" Type="Double" />
                <asp:Parameter Name="MCV" Type="Double" />
                <asp:Parameter Name="MCH" Type="Double" />
                <asp:Parameter Name="MCHC" Type="Double" />
                <asp:Parameter Name="Plytki_krwi" Type="Double" />
                <asp:Parameter Name="RDW_SD" Type="Double" />
                <asp:Parameter Name="RDW_CV" Type="Double" />
                <asp:Parameter Name="PDW" Type="Double" />
                <asp:Parameter Name="MPV" Type="Double" />
                <asp:Parameter Name="P_LCR" Type="Double" />
                <asp:Parameter Name="PCT" Type="Double" />
                <asp:Parameter Name="p_neutrocyty" Type="Double" />
                <asp:Parameter Name="p_limfocyty" Type="Double" />
                <asp:Parameter Name="p_monocyty" Type="Double" />
                <asp:Parameter Name="p_eozynocyty" Type="Double" />
                <asp:Parameter Name="p_bazocyty" Type="Double" />
                <asp:Parameter Name="neurocyty" Type="Double" />
                <asp:Parameter Name="limfocyty" Type="Double" />
                <asp:Parameter Name="monocyty" Type="Double" />
                <asp:Parameter Name="eozynocyty" Type="Double" />
                <asp:Parameter Name="bazocyty" Type="Double" />
                <asp:Parameter Name="NRBC" Type="Double" />
                <asp:Parameter Name="potas" Type="Double" />
                <asp:Parameter Name="kreatynina" Type="Double" />
                <asp:Parameter Name="id_pacjenta" Type="Int32" />
                <asp:Parameter Name="id_lekarza" Type="Int32" />
                <asp:Parameter Name="id_badania" Type="Int32" />
            </UpdateParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server"></asp:SqlDataSource>
</p>
    <p>
        &nbsp;</p>
</asp:Content>
